while {true} do
{

  //Heartbeat script

  //Keeping date uptodate for JIP player
  Sync_time = date;
  publicvariable "Sync_time";

  
  //Let see if a group have no unit alive, then we will destroy it to free ressource for moar ennemy (arma 2 is limited to 177 group) !
  _code=
  {
  
  _numgroup = count allGroups;
  //{ if ((_x!=vtsdummygroup) and (_x!=vtsdummygrouphidden)) then {deleteGroup _x}; } forEach allGroups;
  {deleteGroup _x} forEach allGroups;
  if (_numgroup>165) then
  {
    //Hint the Game master about too much group create in the area
    _code = compile format["if (player==user1) then {hint ""!!! Warning you have %1 groups on 177 maximum allowed !!!"";};",_numgroup];
  };  
  
  };
  
  
    [_code] execVM "scripts\VTS_Functions\runcodeonallclients.sqf";
  

  sleep 120;
  
};
